package com.asia5b.a5bmall.same.adapter

import android.widget.ImageView
import com.asia5b.a5bmall.same.R
import com.asia5b.a5mall.middleware.model.bean.SelectText
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * Created by zhangyuncai on 2020/1/9.
 */
class SelectBaseAdapter(list: ArrayList<SelectText>) :
        BaseQuickAdapter<SelectText, BaseViewHolder>(R.layout.item_selectbase_adapter, list) {
    var selectText: SelectText? = null
    override fun convert(helper: BaseViewHolder, item: SelectText) {

        helper.setText(R.id.tv_selectbase_name, item.getText())
        val iv_selecttrans_check = helper.getView<ImageView>(R.id.iv_selectbase_check)
        iv_selecttrans_check.isSelected = selectText!=null&&item.getSelectId()!=-1&&(selectText!!.getSelectId()==item.getSelectId())
    }
}